<div style="clear: both;height:10px"></div>
<?php 
if(isset($_SESSION['config_template']))
{
	if($_SESSION['config_template']=='layoutmain_web1')
	{
	?>
	<link href="/css/web1/LastQA_style.css" type="text/css" rel="stylesheet" />
		<div class="home_head">
						<div class="left_home_head"><span></span></div>
						<div class="center_home_head">
							<h2 style="float: left; width:20%; background:url(../../images/web1/icon_08.gif) no-repeat 100% 0% !important;"><?php  echo $title;    ?></h2>
							<?php if (isset($permission) && $permission == "true") { ?>
							<div style="float:right; width:77%;font-weight: normal;font-size: 16px" id="pageindex">
									<ul class="gallery clearfix" style="float: left;margin-top:5px">
										<a href="/lastestqa/clickchange?iframe=true&width=370&height=280" rel="prettyPhoto[iframe]">
											<img src="/images/Pencil.png" style="width:20px ; height:20px;margin-left:10px; margin-top:0px;"></img>
										</a>
									</ul>
										<ul class="gallery clearfix" style="float: right;font-size:11px;margin-top:7px;">
											<a id="askquestion" rel="prettyPhoto[iframe]" href="/qa/post?iframe=true&amp;width=600&amp;height=530">+ <?php echo $pq?></a>
										</ul>
							</div>
							<?php }?>
							<?php  $func= new Util()?>
						</div>	
						<div class="right_home_head"><span>	</span></div>
						<div class="floatright"></div>
					</div>
					<div class="content_best">
					<?php foreach ($AllLastestQA as $lastestQA){ 
							$ngay=$func->change_int_to_date($lastestQA['update_date']);;
							?>
								<div class="portfolio">
									<div class="portfolio_content">
										<div style="width:20%;margin-top:10px;" class="avatar_qa">
										<img width="150" height="100" class="imgpf" alt="" onerror="this.src='/images/noimage.jpg'" src="<?php if($lastestQA['avatar'] != null){echo $lastestQA['avatar'];}else{echo "/images/noimage.jpg";}?>">
										</div>
										<div class="p_content" style = "margin-left : 2px;">
											<h3><?php echo $question?> <?php echo $lastestQA['title']?></h3>
											<span class="date"><?php echo $by?><span style="font-weight:bold;"><?php echo $lastestQA['user_name'];?></span>  -  <?php echo $date?> <?php echo $ngay?> </span>
											<br>
											<p><?php echo $lastestQA['short_description']?></p>
										</div>
										<button onclick="document.location.href='/qa/detail?id=<?php echo $lastestQA['thing_id'];?>'" class="form-button floatright" value="Detail" name="btnDetails" type="button">
											<span><?php echo $btndetail ?></span>
										</button>	
										<div class="line_content"></div>				
									</div><!--end portfolio_content-->
																	
								</div>
								<div style="clear:both;"></div>
							<?php }?>
					</div>
					<div style="height:20px" class="bottom_best"><span></span></div>
<?php
    } else 	if($_SESSION['config_template']=='layoutmain_web2') { ?>
	<div class="content_block">
		<div class="content_block_left">
			<div class="product_head">
				<h2><a style="float:left;width:auto;"> <?php echo $title;?></a></h2>
				<?php if(isset($permission) && $permission=="true") {?>
				<ul class="gallery clearfix" style="float: left;">
					<a href="/lastestqa/clickchange?iframe=true&width=370&height=280" rel="prettyPhoto[iframe]">
						<img src="/images/Pencil.png" style="width:20px; height:20px;margin-left:25px;"></img>
					</a>
				</ul>
				<!-- Tạo cây bút chì cho click and change -->
				<div class="floatright">
					<div id="pageindex">
						
						<ul class="gallery clearfix" style="float: right;">
							<h2><a href="/qa/post?iframe=true&width=600&height=530" rel="prettyPhoto[iframe]" id="askquestion">+ <?php echo $pq?></a></h2>
						</ul>
					</div>
				</div>
				<!-- End - Tạo cây bút chì cho click and change -->
				<?php } ?>
			</div>
			<div class="listing-type-list catalog-listing">
				<?php  $func= new Util()?>
				<?php foreach ($AllLastestQA as $lastestQA){ 
					$ngay=$func->change_int_to_date($lastestQA['update_date']);
				?>	
			    <div class="listing-item">
			        <div class="product-image">
			            <a title="" href="#">
			                <img height="135" width="135" onerror="this.src='/images/noimage.jpg'" title="<?php echo $lastestQA['title']?>" alt="<?php echo $lastestQA['title']?>" src="<?php if($lastestQA['avatar'] != null){echo $lastestQA['avatar'];}else{echo "/images/noimage.jpg";}?>">
			            </a>
			        </div>
			
			        <div class="product-shop">
			            <h5><a title="<?php echo $lastestQA['title']?>" href="/qa/detail?id=<?php echo $lastestQA['thing_id'];?>"><?php echo $question?> <?php echo $lastestQA['title']?></a></h5>
			                                                
						<div class="price-box">
			                <span id="ByName" class="regular-price">
			                    <strong><?php echo $by?> </strong><span class="price"><?php echo $lastestQA['user_name'];?></span>
							</span>
			                <span id="Date" class="regular-price">
			                    <strong>&nbsp;-&nbsp;<?php echo $date?></strong><span class="price"><?php echo $ngay?></span>
							</span> 
						</div>
						
						
			            <div class="clear"></div>
			            <div class="description">
			                <?php echo $lastestQA['short_description']?>
							<span><button onclick="setLocation('/qa/detail?id=<?php echo $lastestQA['thing_id'];?>')" class="form-button" style="float:right;"><span><?php echo $btndetail ?></span></button></span>
			            </div>
						
			        </div>
			    </div>
			<?php  }?>			
			</div>
		</div>
	</div>
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="/css/LastQA_style.css" />
<p><?php
            echo $title;
            ?></p>
<?php
            if (isset($permission) && $permission == "true") {
                ?>
<div class="floatright">
<div id="pageindex">
<ul class="gallery clearfix">
	<a href="/qa/post?iframe=true&width=600&height=530"
		rel="prettyPhoto[iframe]" id="askquestion">+ <?php
                echo $pq?></a>
</ul>
</div>
</div>
<!-- Tạo cây bút chì cho click and change -->
<ul class="gallery clearfix">
	<a href="/lastestqa/clickchange?iframe=true&width=370&height=280"
		rel="prettyPhoto[iframe]"> <img src="/images/Pencil.png"
		style="width: 20px; height: 20px; margin-left: 25px; margin-top: 0px;"></img>
	</a>
</ul>
<!-- End - Tạo cây bút chì cho click and change -->
<?php }?>

<?php  $func= new Util()?>
<div style="clear: both;"></div>

<div class="line">
<hr>
</div>
<?php foreach ($AllLastestQA as $lastestQA){ 
				$ngay=$func->change_int_to_date($lastestQA['update_date']); ?>
			<div class="portfolio">
				<div class="portfolio_top">
				</div><!--end portfolio_top-->
				<div class="portfolio_content">
				</div><!--end portfolio_content-->
				<div class="portfolio_bottom">
				</div><!--end portfolio_bottom-->
				<div class="avatar_qa">
					<img src="<?php if($lastestQA['avatar'] != null){echo $lastestQA['avatar'];}else{echo "/images/noimage.jpg";}?>" onerror="this.src='/images/noimage.jpg'" alt="" class="imgpf" width="180" height="135" />
				</div>
				<div class="p_content">
					<h3><?php echo $question?> <?php echo $lastestQA['title']?></h3>
					<span class="date"><?php echo $by?> <span style="font-weight:bold;"><?php echo $lastestQA['user_name'];?></span>  -  <?php echo $date?> <?php echo $ngay?> </span>
					<br />
					<p><?php echo $lastestQA['short_description']?></p>
				</div>
				<div class="button_class"><input type="button" name="btnDetails"
					style="background-image: url('../images/but_details2.png'); color: white; border: none; text-align: center; float: right;"
					value="<?php echo $btndetail ?>" class="btnDetail"
					onclick="document.location.href='/qa/detail?id=<?php echo $lastestQA['thing_id'];?>'" />
				</div>												
			</div>
			<?php  }?>
 
<?php }}?>
<div style="clear: both;"></div>	